package com.briup.product_my.controller;

import com.briup.product_my.domain.ext.DiseaseRecordExt;
import com.briup.product_my.result.Result;
import com.briup.product_my.service.AnalysisService;
import com.briup.product_my.service.DiseaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: xiongwenbin
 * @Date: 2024/8/23-08-23-下午2:32
 * @Description: com.briup.product_my.controller
 */
@RestController
@RequestMapping("/analysis")
@Api(tags = "数据分析")
public class AnalysisController {
    @Autowired
    private AnalysisService analysisService;
    @Autowired
    private DiseaseService diseaseService;

    @ApiOperation(value = "获取对应数据信息数量")
    @GetMapping("/count")
    public Result count(){
        return Result.success(analysisService.count());
    }
    @ApiOperation(value = "体重信息")
    @GetMapping("/indexCount")
    public Result indexCount(){
        return Result.success(analysisService.indexCount());
    }
    @ApiOperation(value = "病症信息")
    @GetMapping("/countDisease")
    public Result countDisease(){
        return Result.success(diseaseService.indexCount());
    }
    @ApiOperation(value = "销售信息")
    @GetMapping("/countSales")
    public Result countSales(){
        return Result.success(analysisService.countSales());
    }
}
